<?php

class User_Form_CreateCharacter extends Pldkp_Form 
{ 
    public function init()
    { 
        $this->setName('createCharacter');

        $name = new Zend_Form_Element_Text('name');
        $name->setRequired(true)
              ->setLabel('Name')
              ->addValidator('NotEmpty')
              ->addValidator('UniqueEntry',false,array('table'=> 'User_Model_Characters', 'field'=>'name'));
              
        $class = new Zend_Form_Element_Select('class');
        $class->setLabel('Class')
              ->setMultiOptions(User_Model_Classes::getClasses())
              ->setRequired(true)->addValidator('NotEmpty', true);
              
              
        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setLabel('Create');
        
        $this->addElements(array($name, $class, $submit));
    }
}